# set QTCANPOOL_DIR
get_filename_component(QTCANPOOL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../qtcanpool" ABSOLUTE)

if(NOT EXISTS "${QTCANPOOL_DIR}")
    message(FATAL_ERROR "Directory ${QTCANPOOL_DIR} does not exist.")
endif()

## Add paths to check for cmake modules:
list(APPEND CMAKE_MODULE_PATH "${QTCANPOOL_DIR}/cmake")
include(QtCanpoolBranding RESULT_VARIABLE IDE_BRANDING_FILE)
include(QtCanpoolAPI)

project(qxmaterial LANGUAGES CXX)

option(WITH_EXAMPLES "Build examples" ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5
  ${IDE_QT_VERSION_MIN}
  COMPONENTS Concurrent Core Gui Widgets
    Core5Compat
  REQUIRED
)
if (Qt5_VERSION VERSION_LESS 6.0.0)
  install(TARGETS Qt6Core5Compat EXPORT QtCanpool)
endif()

if (WITH_EXAMPLES)
    add_subdirectory(examples)
endif()
